package com.card.client.dialog;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class ShowCreditCardBillInfoDialog extends DialogBox {

	private static ShowCreditCardBillInfoDialogUiBinder uiBinder = GWT
			.create(ShowCreditCardBillInfoDialogUiBinder.class);

	interface ShowCreditCardBillInfoDialogUiBinder extends
			UiBinder<Widget, ShowCreditCardBillInfoDialog> {
	}

	@UiField TextBox cardName;
	
	@UiField TextBox financeMonth;
	
	@UiField TextBox lastRePayDate;
	
	@UiField TextBox rePayDate;
	
	@UiField TextBox minRePay;
	
	@UiField TextBox actualRePay;
	
	@UiField TextBox overAmount;
	
	@UiField TextBox interest;
	
	@UiField TextBox overCost;
	
	@UiField TextBox excess;
	
	@UiField TextBox takeAmount;
	
	@UiField TextBox takeDate;
	
	@UiField Button submit;
	

	public ShowCreditCardBillInfoDialog(String title, String descript, String[] content) {
		setWidget(uiBinder.createAndBindUi(this));
		setTitle(title);
		setText(descript);
		setGlassEnabled(true);
		setAnimationEnabled(true);
		setModal(true);
		center();
		cardName.setReadOnly(true);
		financeMonth.setReadOnly(true);
		lastRePayDate.setReadOnly(true);
		rePayDate.setReadOnly(true);
		minRePay.setReadOnly(true);
		actualRePay.setReadOnly(true);
		overAmount.setReadOnly(true);
		interest.setReadOnly(true);
		overCost.setReadOnly(true);
		excess.setReadOnly(true);
		takeAmount.setReadOnly(true);
		takeDate.setReadOnly(true);
		cardName.setText(content[0]);
		financeMonth.setText(content[1]);
		lastRePayDate.setText(content[2]);
		rePayDate.setText(content[3]);
		minRePay.setText(content[4]);
		actualRePay.setText(content[5]);
		overAmount.setText(content[6] + "元");
		interest.setText(content[7] + "元");
		overCost.setText(content[8] + "元");
		excess.setText(content[9] + "元");
		takeAmount.setText(content[10] + "元");
		takeDate.setText(content[11]);
	}

	@UiHandler("submit")
	void onClick(ClickEvent e) {
		hide();
	}

}
